<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <div>使用 {{num}}</div>
        <button @click="addNum">修改</button>
        <button @click="addNum2(2)">修改+2</button>
    </div>

</body>
<script>
    let vm = new Vue({
        el: "#app",
        data: {
            num: 10
        },
        methods: {
            addNum() {
                 this.num++;
            },
            addNum2(num){
                this.num  = this.num+num;
            }
        }
    })
   // console.log(vm);


    

    

</script>

</html>